/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hiddendanger.uitls;

public enum BusinessCode {
    SUCCESS(0,"success"),
    FAILURE(-1,"fail"),
    EXCEPTION(-2,"执行过程中发生异常"),
    NOT_LONGIN(10000,"没有登录，无法执行操作"),
    PARAM_NOT_EMPTY(-3,"所选参数不能为空"),
    FREESNAP_ILEAGEL_OPERATIONTYPE(410001,"操作类型值不合法"),
    FREESNAP_EMPTY_OPERATIONTYPE(410002,"操作类型为空"),
    FREESNAP_EMPTY_DESCRIPTION(410003,"随手拍描述不能为空"),
    FREESNAP_EMPTY_CORPCODE(410004,"随手拍所属水司不能为空"),
    FREESNAP_EMPTY_GRIDCODE(410005,"随手拍所属位置不能为空"),
    FREESNAP_EMPTY_SUBMITCODE(410006,"提交人不能为空"),
    FREESNAP_FILE_GREATER(410007,"随手拍上传的图片大于3张"),
    FREESNAP_EMPTY_ID(410008,"id主键为空"),
    FREESNAP_EMPTY_CHANGE_DATA(410009,"未选中数据"),
    FREESNAP_NOT_EXISIT(410010,"随手拍不存在"),
    FREESNAP_IS_SUBMITTED(410010,"选中的随手拍已提交,无法进行操作"),
    DANGER_EMPTY_CHANGE_DATA(410011,"未选中数据"),
    DANGER_NOT_EXISIT(410012,"隐患不存在"),
    DANGER_NOT_DRAFT(410013,"选中的隐患不是草稿状态，无法进行操作"),
    DANGER_EMPTY_DESCRIPTION(410014,"隐患描述不能为空"),
    DANGER_EMPTY_CORPCODE(410015,"隐患所属水司不能为空"),
    DANGER_EMPTY_GRIDCODE(410016,"隐患所属网格区域不能为空"),
    DANGER_ILEAGEL_OPERATIONTYPE(410017,"操作类型值不合法"),
    DANGER_EMPTY_OPERATIONTYPE(410018,"操作类型为空"),
    DANGER_EMPTY_ELEMENTFRISTTYPE(410019,"隐患确认时所属八要素一级分类不能为空"),
    DANGER_EMPTY_ELEMENTSECONDTYPE(410020,"隐患确认时所属八要素二级分类不能为空"),
    DANGER_EMPTY_DANGERTYPE(410021,"隐患确认时所属隐患分类不能为空"),
    DANGER_EMPTY_DANGERLEVEL(410022,"隐患确认时所属隐患分级不能为空"),
    DANGERRECTIFICATION_EMPTY_SOLUTION(410023,"隐患确认时整改措施不能为空"),
    DANGERRECTIFICATION_EMPTY_RECTIFIER(410024,"隐患确认时整改负责人不能为空"),
    DANGERRECTIFICATION_EMPTY_REVIEWER(410025,"隐患确认时整改结果验证人不能为空"),
    DANGERRECTIFICATION_EMPTY_DEADLINE(410026,"隐患确认时整改期限不能为空"),
    DANGERRECTIFICATION_EMPTY_CHANGE_DATA(410027,"未选中数据"),
    DANGERRECTIFICATION_NOT_EXISIT(410028,"不存在的隐患整改记录"),
    DANGERRECTIFICATION_EMPTY_REVIEWRESULT(410029,"隐患整改结果确认时确认结果不能为空"),
    DANGER_IS_COMMITED(410030,"隐患已提交，无法进行操作"),
    PERFORMANCEPLAN_EMPTY_CHANGE_DATA(410031,"未选中数据"),
    PERFORMANCEPLAN_NOT_EXISIT(410032,"检查计划不存在"),
    PERFORMANCEPLAN_IS_PROCESSING(410033,"检查计划正在使用或正在审批中，无法进行操作,您可以尝试先暂停计划在进行删除操作"),
    PERFORMANCEPLAN_EMPTY_NAME(410034,"检查计划名称不能为空"),
    PERFORMANCEPLAN_EMPTY_CORPCODE(410035,"检查计划所在水司不能为空"),
    PERFORMANCEPLAN_EMPTY_GRIDCODE(410036,"检查计划受检单位不能为空"),
    PERFORMANCEPLAN_EMPTY_PLANCREATER(410037,"检查计划创建人不能为空"),
    PERFORMANCEPLAN_EMPTY_PLANAPPROVER(410038,"检查计划审批人不能为空"),
    PERFORMANCEPLAN_EMPTY_EXECUTORS (410039,"检查计划执行人不能为空"),
    PERFORMANCEPLAN_EMPTY_MANAGER(410040,"检查计划最终负责人不能为空"),
    PERFORMANCEPLAN_EMPTY_REPEATTYPE(410041,"检查计划周期类型不能为空"),
    PERFORMANCEPLAN_EMPTY_BEGINTIME(410042,"检查计划开始时间不能为空"),
    PERFORMANCEPLAN_IS_PAUSE(410043,"检查计划已经暂停了"),
    PERFORMANCEPLAN_IS_RUNNING(410044,"检查计划正在执行中"),
    CHECKRECORD_EMPTY_NAME(410045,"检查记录名称不能为空"),
    CHECKRECORD_EMPTY_CROPCODE(410046,"检查记录的检查范围-水司不能为空"),
    CHECKRECORD_EMPTY_SUBMITCODE(410047,"检查记录的填写人code不能为空"),
    CHECKRECORD_EMPTY_MANAGER(410048,"检查记录的负责人不能为空"),
    CHECKRECORD_NOT_EXISIT(410049,"检查记录不存在"),
    CHECKRECORD_IS_COMMITED(410050,"检查记录已经提交了，无法进行操作"),
    CHECKRECORD_EMPTY_CHANGE_DATA(410051,"未选中数据"),
    CHECKRECORD_EMPTY_CHANGE_FILE(410052,"未选中文件"),
    CHECKRECORD_REFERENCE_NOT_EXISIT(410053,"检查记录没有填写相关的该检查表的记录"),
    CHECKRECORD_REFERENCE_EMPTY_CROPCODE(410054,"检查范围-水司不能为空"),
    CHECKRECORD_REFERENCE_EMPTY_CHECKRECORDID(410055,"检查记录id不能为空"),
    CHECKRECORD_REFERENCE_EMPTY_CHECKLISTENTRYID(410056,"检查表id不能为空"),
    CHECKRECORD_REFERENCE_NOT_EXISIT_CHECKRECORDID(410057,"检查记录不存在"),
    CHECKRECORD_REFERENCE_NOT_EXISIT_CHECKLISTENTRYID(410058,"检查表不存在"),
    CHECKRECORD_ITEMRECORD_EMPTY_ITEMNAME(410059,"检查项名称不能为空"),
    CHECKRECORD_ITEMRECORD_EMPTY_CHECKLISTITEMID(410060,"检查项id不能为空"),
    CHECKRECORD_ITEMRECORD_EMPTY_ITEMINDEX(410061,"检查项序号不能为空"),
    CHECKRECORD_ITEMRECORD_EMPTY_NORMAL(410062,"是否符合不能为空"),
    FREESNAP_CONFIRM_HAZARD_EMPTY_NAME(410063,"随手拍确认为危险源时危险源名称不能为空"),
    FREESNAP_CONFIRM_HAZARD_EMPTY_BUSINESSTYPE(410064,"随手拍确认为危险源时危险源所属业态不能为空"),
    FREESNAP_CONFIRM_HAZARD_EMPTY_HAZARDTYPE(410065,"随手拍确认为危险源时危险源类型不能为空"),
    NOT_FOUNT_GRIDMANAGER(410066,"找不到对应的网格负责人，无法启动流程"),
    NOT_FOUNT_FLOWINSID(410067,"转办任务时工作流实例不能为空"),
    DANGERCONFIRM_IS_NOT_FOUND_GRID(410068,"隐患当前网格节点为空，无法找到对应的上一级网格负责人"),
    DANGERCONFIRM_IS_NOT_FOUND_NEXT_GRID(410068,"无法找到对应的上一级网格负责人"),
    DANGER_FLOW_IS_STARTED(410069,"选中的隐患已经启动了流程，无法再次启动"),
    DANGERRECTIFICATION_EMPTY_DELAYDATE(410070,"申请整改延期日期不能为空"),
    DANGERRECTIFICATION_EMPTY_DELAYREASON(410071,"申请整改延期理由不能为空"),
    DANGERRECTIFICATION_EMPTY_REFUSEDELAYREASON(410072,"拒绝整改延期理由不能为空"),
    PERFORMANCEPLAN_IS_DISCDRD(410073,"检查计划已被废弃无法操作，请新建另发起流程"),
    DEADLINE_AFTER_PERIOD(410074,"隐患整改期限不能超过要求的整改时限"),
    SUBMITTER_NOT_FOUND(410075,"发起人不存在"),
    ;
    private final int code;
    private final String description;

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    BusinessCode(int code, String description) {
        this.code = code;
        this.description = description;
    }
    public static BusinessCode valueOf(int value){
        return switch (value) {
            case 0 -> SUCCESS;
            case -1 -> FAILURE;
            case -2 -> EXCEPTION;
            case 10000 -> NOT_LONGIN;
            case 410001 -> FREESNAP_ILEAGEL_OPERATIONTYPE;
            case 410002 -> FREESNAP_EMPTY_OPERATIONTYPE;
            case 410003 -> FREESNAP_EMPTY_DESCRIPTION;
            case 410004 -> FREESNAP_EMPTY_CORPCODE;
            case 410005 -> FREESNAP_EMPTY_GRIDCODE;
            case 410006 -> FREESNAP_EMPTY_SUBMITCODE;
            case 410007 -> FREESNAP_FILE_GREATER;
            case 410008 -> FREESNAP_EMPTY_ID;
            case 410009 -> FREESNAP_EMPTY_CHANGE_DATA;
            case 410010 -> FREESNAP_NOT_EXISIT;
            case 410011 -> DANGER_EMPTY_CHANGE_DATA;
            case 410012 -> DANGER_NOT_EXISIT;
            case 410013 -> DANGER_NOT_DRAFT;
            case 410014 -> DANGER_EMPTY_DESCRIPTION;
            case 410015 -> DANGER_EMPTY_CORPCODE;
            case 410016 -> DANGER_EMPTY_GRIDCODE;
            case 410017 -> DANGER_ILEAGEL_OPERATIONTYPE;
            case 410018 -> DANGER_EMPTY_OPERATIONTYPE;
            case 410019 -> DANGER_EMPTY_ELEMENTFRISTTYPE;
            case 410020 -> DANGER_EMPTY_ELEMENTSECONDTYPE;
            case 410021 -> DANGER_EMPTY_DANGERTYPE;
            case 410022 -> DANGER_EMPTY_DANGERLEVEL;
            case 410023 -> DANGERRECTIFICATION_EMPTY_SOLUTION;
            case 410024 -> DANGERRECTIFICATION_EMPTY_RECTIFIER;
            case 410025 -> DANGERRECTIFICATION_EMPTY_REVIEWER;
            case 410026 -> DANGERRECTIFICATION_EMPTY_DEADLINE;
            case 410027 -> DANGERRECTIFICATION_EMPTY_CHANGE_DATA;
            case 410028 -> DANGERRECTIFICATION_NOT_EXISIT;
            case 410029 -> DANGERRECTIFICATION_EMPTY_REVIEWRESULT;
            case 410030 -> DANGER_IS_COMMITED;
            case 410031 -> PERFORMANCEPLAN_EMPTY_CHANGE_DATA;
            case 410032 -> PERFORMANCEPLAN_NOT_EXISIT;
            case 410033 -> PERFORMANCEPLAN_IS_PROCESSING;
            case 410034 -> PERFORMANCEPLAN_EMPTY_NAME;
            case 410035 -> PERFORMANCEPLAN_EMPTY_CORPCODE;
            case 410036 -> PERFORMANCEPLAN_EMPTY_GRIDCODE;
            case 410037 -> PERFORMANCEPLAN_EMPTY_PLANCREATER;
            case 410038 -> PERFORMANCEPLAN_EMPTY_PLANAPPROVER;
            case 410039 -> PERFORMANCEPLAN_EMPTY_EXECUTORS;
            case 410040 -> PERFORMANCEPLAN_EMPTY_MANAGER;
            case 410041 -> PERFORMANCEPLAN_EMPTY_REPEATTYPE;
            case 410042 -> PERFORMANCEPLAN_EMPTY_BEGINTIME;
            case 410043 -> PERFORMANCEPLAN_IS_PAUSE;
            case 410044 -> PERFORMANCEPLAN_IS_RUNNING;
            case 410045 -> CHECKRECORD_EMPTY_NAME;
            case 410046 -> CHECKRECORD_EMPTY_CROPCODE;
            case 410047 -> CHECKRECORD_EMPTY_SUBMITCODE;
            case 410048 -> CHECKRECORD_EMPTY_MANAGER;
            case 410049 -> CHECKRECORD_NOT_EXISIT;
            case 410050 -> CHECKRECORD_IS_COMMITED;
            case 410051 -> CHECKRECORD_EMPTY_CHANGE_DATA;
            case 410052 -> CHECKRECORD_EMPTY_CHANGE_FILE;
            case 410053 -> CHECKRECORD_REFERENCE_EMPTY_CROPCODE;
            case 410054 -> CHECKRECORD_REFERENCE_EMPTY_CHECKRECORDID;
            case 410055 -> CHECKRECORD_REFERENCE_NOT_EXISIT_CHECKRECORDID;
            case 410056 -> CHECKRECORD_REFERENCE_EMPTY_CHECKLISTENTRYID;
            case 410057 -> CHECKRECORD_REFERENCE_NOT_EXISIT_CHECKRECORDID;
            case 410058 -> CHECKRECORD_REFERENCE_NOT_EXISIT_CHECKLISTENTRYID;
            case 410059 -> CHECKRECORD_ITEMRECORD_EMPTY_ITEMNAME;
            case 410060 -> CHECKRECORD_ITEMRECORD_EMPTY_CHECKLISTITEMID;
            case 410061 -> CHECKRECORD_ITEMRECORD_EMPTY_ITEMINDEX;
            case 410062 -> CHECKRECORD_ITEMRECORD_EMPTY_NORMAL;
            case 410063 -> FREESNAP_CONFIRM_HAZARD_EMPTY_NAME;
            case 410064 -> FREESNAP_CONFIRM_HAZARD_EMPTY_BUSINESSTYPE;
            case 410065 -> FREESNAP_CONFIRM_HAZARD_EMPTY_HAZARDTYPE;
            case 410066 -> NOT_FOUNT_GRIDMANAGER;
            case 410067 -> DANGERCONFIRM_IS_NOT_FOUND_GRID;
            case 410068 -> DANGERCONFIRM_IS_NOT_FOUND_NEXT_GRID;
            case 410069 -> DANGER_FLOW_IS_STARTED;
            case 410070 -> DANGERRECTIFICATION_EMPTY_DELAYDATE;
            case 410071 -> DANGERRECTIFICATION_EMPTY_DELAYREASON;
            case 410072 -> DANGERRECTIFICATION_EMPTY_REFUSEDELAYREASON;
            case 410073 -> PERFORMANCEPLAN_IS_DISCDRD;
            default -> null;
        };
    }
}
